Optimal. Leaf size=146 \[ \frac {5 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a^{3/2} d}-\frac {7 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {2} a^{3/2} d}-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 146, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {4105, 4107,
4005, 3859, 209, 3880} \begin {gather*} \frac {5 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a^{3/2} d}-\frac {7 A \text {ArcTan}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {2} a^{3/2} d}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}}-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 3859
Rule 3880
Rule 4005
Rule 4105
Rule 4107
Rubi steps
\begin {align*} \int \frac {\cos (c+d x) (A+A \sec (c+d x))}{(a-a \sec (c+d x))^{3/2}} \, dx &=-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {\int \frac {\cos (c+d x) (4 a A+3 a A \sec (c+d x))}{\sqrt {a-a \sec (c+d x)}} \, dx}{2 a^2}\\ &=-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}}-\frac {\int \frac {-5 a^2 A-2 a^2 A \sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx}{2 a^3}\\ &=-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}}+\frac {(5 A) \int \sqrt {a-a \sec (c+d x)} \, dx}{2 a^2}+\frac {(7 A) \int \frac {\sec (c+d x)}{\sqrt {a-a \sec (c+d x)}} \, dx}{2 a}\\ &=-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}}+\frac {(5 A) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a d}-\frac {(7 A) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,\frac {a \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a d}\\ &=\frac {5 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {a-a \sec (c+d x)}}\right )}{a^{3/2} d}-\frac {7 A \tan ^{-1}\left (\frac {\sqrt {a} \tan (c+d x)}{\sqrt {2} \sqrt {a-a \sec (c+d x)}}\right )}{\sqrt {2} a^{3/2} d}-\frac {A \sin (c+d x)}{d (a-a \sec (c+d x))^{3/2}}+\frac {2 A \sin (c+d x)}{a d \sqrt {a-a \sec (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.73, size = 281, normalized size = 1.92 \begin {gather*} \frac {A \left (\sqrt {2} e^{-\frac {1}{2} i (c+d x)} \sqrt {\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}} \sqrt {1+e^{2 i (c+d x)}} \left (5 i d x-5 \sinh ^{-1}\left (e^{i (c+d x)}\right )-7 \sqrt {2} \log \left (1-e^{i (c+d x)}\right )-5 \log \left (1+\sqrt {1+e^{2 i (c+d x)}}\right )+7 \sqrt {2} \log \left (1+e^{i (c+d x)}+\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}\right )\right )+\frac {1}{2} \left (-2 \cos \left (\frac {1}{2} (c+d x)\right )-3 \cos \left (\frac {3}{2} (c+d x)\right )+\cos \left (\frac {5}{2} (c+d x)\right )\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right ) \sqrt {\sec (c+d x)}\right ) \sec ^{\frac {3}{2}}(c+d x) \sin ^3\left (\frac {1}{2} (c+d x)\right )}{d (a-a \sec (c+d x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(461\) vs.
\(2(127)=254\).
time = 8.77, size = 462, normalized size = 3.16
method | result | size |
default | \(\frac {A \left (-1+\cos \left (d x +c \right )\right )^{3} \left (-3 \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}-6 \sqrt {2}\, \cos \left (d x +c \right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}-7 \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right ) \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}}-3 \sqrt {2}\, \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {5}{2}}+3 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \left (\cos ^{3}\left (d x +c \right )\right )+21 \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right ) \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right )-2 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right )+7 \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sqrt {2}+5 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}\, \cos \left (d x +c \right )+30 \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right ) \left (\cos ^{2}\left (d x +c \right )\right )-21 \sqrt {2}\, \arctan \left (\frac {1}{\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}}\right )-6 \sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}-30 \arctan \left (\frac {\sqrt {-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}}\, \sqrt {2}}{2}\right )\right ) \sqrt {2}}{3 d \left (-\frac {2 \cos \left (d x +c \right )}{1+\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \left (\frac {a \left (-1+\cos \left (d x +c \right )\right )}{\cos \left (d x +c \right )}\right )^{\frac {3}{2}} \sin \left (d x +c \right )^{5}}\) | \(462\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.25, size = 526, normalized size = 3.60 \begin {gather*} \left [-\frac {7 \, \sqrt {2} {\left (A \cos \left (d x + c\right ) - A\right )} \sqrt {-a} \log \left (\frac {2 \, \sqrt {2} {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} + {\left (3 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{{\left (\cos \left (d x + c\right ) - 1\right )} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) + 10 \, {\left (A \cos \left (d x + c\right ) - A\right )} \sqrt {-a} \log \left (\frac {2 \, {\left (\cos \left (d x + c\right )^{2} + \cos \left (d x + c\right )\right )} \sqrt {-a} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} - {\left (2 \, a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right )}{\sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) + 4 \, {\left (A \cos \left (d x + c\right )^{3} - A \cos \left (d x + c\right )^{2} - 2 \, A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}}}{4 \, {\left (a^{2} d \cos \left (d x + c\right ) - a^{2} d\right )} \sin \left (d x + c\right )}, \frac {7 \, \sqrt {2} {\left (A \cos \left (d x + c\right ) - A\right )} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 10 \, {\left (A \cos \left (d x + c\right ) - A\right )} \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}} \cos \left (d x + c\right )}{\sqrt {a} \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 2 \, {\left (A \cos \left (d x + c\right )^{3} - A \cos \left (d x + c\right )^{2} - 2 \, A \cos \left (d x + c\right )\right )} \sqrt {\frac {a \cos \left (d x + c\right ) - a}{\cos \left (d x + c\right )}}}{2 \, {\left (a^{2} d \cos \left (d x + c\right ) - a^{2} d\right )} \sin \left (d x + c\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} A \left (\int \frac {\cos {\left (c + d x \right )}}{- a \sqrt {- a \sec {\left (c + d x \right )} + a} \sec {\left (c + d x \right )} + a \sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx + \int \frac {\cos {\left (c + d x \right )} \sec {\left (c + d x \right )}}{- a \sqrt {- a \sec {\left (c + d x \right )} + a} \sec {\left (c + d x \right )} + a \sqrt {- a \sec {\left (c + d x \right )} + a}}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.14, size = 177, normalized size = 1.21 \begin {gather*} \frac {\frac {7 \, \sqrt {2} A \arctan \left (\frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{\sqrt {a}}\right )}{a^{\frac {3}{2}}} - \frac {10 \, A \arctan \left (\frac {\sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a}}{2 \, \sqrt {a}}\right )}{a^{\frac {3}{2}}} - \frac {3 \, \sqrt {2} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )}^{\frac {3}{2}} A + 4 \, \sqrt {2} \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a} A a}{{\left ({\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )}^{2} + 3 \, {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a\right )} a + 2 \, a^{2}\right )} a}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\cos \left (c+d\,x\right )\,\left (A+\frac {A}{\cos \left (c+d\,x\right )}\right )}{{\left (a-\frac {a}{\cos \left (c+d\,x\right )}\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________